#import "SMRBorderFrameLine.h"


#pragma mark Constants
static const CGFloat SMRLineBorderPadding = 3.0f;


#pragma mark -
#pragma mark Class Globals


#pragma mark -
@interface SMRBorderFrameLine (SMRLineBorderFramePrivateMethods)

@end


#pragma mark -
@implementation SMRBorderFrameLine

@synthesize lineColor;
@synthesize backgroundColor;


-(id)init {
	if (!(self = [super init]))
		return nil;
	[self setLineColor:[NSColor colorWithCalibratedWhite:0.0f alpha:0.5f]];
	[self setBackgroundColor:[NSColor whiteColor]];
	return self;
}

-(NSRect)imageRectForFrameRect:(NSRect)frameRect {
	return NSInsetRect(frameRect, SMRLineBorderPadding, SMRLineBorderPadding);
}

-(CGFloat)horizontalPadding {
	return SMRLineBorderPadding;
}

-(CGFloat)verticalPadding {
	return SMRLineBorderPadding;
}

-(void)drawFrameUnderImageInRect:(NSRect)aRect {
	NSRect frameRect = NSIntegralRect(aRect);
	frameRect = NSInsetRect(frameRect, 1.5f, 1.5f);
	NSBezierPath *linePath = [NSBezierPath bezierPathWithRect:frameRect];
	[[self backgroundColor] setFill];
	[linePath fill];
	[[self lineColor] setStroke];
	[linePath stroke];
}

-(NSString *)borderFrameTitle {
	return @"Line";
}

@end
